#include <stdio.h>

int main()
{
    int n, a, b;
    double sum = 0, prices[] = {0, 2.98, 4.50, 9.98, 4.49, 6.87};
    scanf("%d", &n);
    while (n-- > 0)
    {
        scanf("%d%d", &a, &b);
        sum += prices[a] * b;
    }
    printf("%.2lf\n", sum);
    return 0;
}

